<?php

namespace app\admin\service;

use app\admin\dao\MemberDao;
use app\admin\model\UM as UM;
use ShidianUtil\Utils\TimeUtil;

/**
 * Class LawyerStatisticsService
 * @package app\member\service
 */
class LawyerStatisticsService
{
    private MemberDao $memberDao;

    public function __construct(MemberDao $memberDao)
    {
        $this->memberDao = $memberDao;
    }

    /**
     *
     * @param UM|null $user
     * @param $followedWechat
     * @param $medal
     * @param $provinceId
     * @param $cityId
     * @param $startTime
     * @param $endTime
     * @param $kw
     * @param $svip
     * @param $svipAgree
     * @return array
     */
    public function read(?UM $user, $followedWechat, $medal, $provinceId, $cityId, $startTime, $endTime, $kw, $svip, $svipAgree, $subType): array
    {
        if (is_numeric($endTime)) {
            $endTime = TimeUtil::stamp(TimeUtil::DAY, $endTime, false);
        }
        return $this->memberDao->statisticsListLawyers($followedWechat, $medal, $provinceId, $cityId, $startTime, $endTime, $kw, $svip, $svipAgree, $subType);
    }


}
